<extend name="Common:common"/>
<block name="main">

    <div class="main-content">
        <div class="breadcrumbs" id="breadcrumbs">
            <script type="text/javascript">
                try {
                    ace.settings.check('breadcrumbs', 'fixed')
                } catch (e) {
                }
            </script>

            <ul class="breadcrumb">
                <li>
                    <i class="icon-home home-icon"></i>
                    <a href="#"> 云系统管理平台</a>
                </li>

                <li>
                    <a href="#">系统基本信息</a>
                </li>
                <li class="active">折线图</li>
            </ul>
            <!-- .breadcrumb -->
            <!-- #nav-search -->
        </div>

        <div class="page-content">
            <h1>{$title}</h1>
            <hr/>
            <div id="main" style="width: 1024px;height:400px;"></div>

        </div>
       </div><!-- /.page-content -->
    </div><!-- /.main-content -->
    <script src="__PUBLIC__/Common/static/js/echarts.min.js"></script>
    <script src="__PUBLIC__/Common/static/js/china.js"></script>
    <script type="text/javascript">
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('main'));

        var locations = [{
            name: '上海',
            coord: [121.472644, 31.231706]
        }, {
            name: '北京',
            coord: [116.405285, 39.904989]
        }, {
            name: '广东',
            coord: [113.280637, 23.839463714285714]
        }];
        option = {
            tooltip: {
                trigger: 'item',
                formatter: '{b}'
            },
            series: [
                {
                    name: '中国',
                    type: 'map',
                    mapType: 'china',
                    selectedMode : 'multiple',
                    label: {
                        normal: {
                            show: true
                        },
                        emphasis: {
                            show: true
                        }
                    }
                }
            ]
        };
        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
        var currentLoc = 0;
        setInterval(function () {
            myChart.setOption({
                series: [{
                    center: locations[currentLoc].coord,
                    zoom: 4,
                    data:[
                        {name: locations[currentLoc].name, selected: true}
                    ],
                    animationDurationUpdate: 1000,
                    animationEasingUpdate: 'cubicInOut'
                }]
            });
            currentLoc = (currentLoc + 1) % locations.length;
        }, 2000);

    </script>
</block>
